{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "输入的整数累加和是: 20\n"
     ]
    }
   ],
   "source": [
    "# 输入一个整数序列\n",
    "numbers = input(\"请输入一组整数，用空格分隔: \").split()\n",
    "\n",
    "# 将输入的字符串转换为整数\n",
    "numbers = [int(num) for num in numbers]\n",
    "\n",
    "# 计算累加和\n",
    "total_sum = sum(numbers)\n",
    "\n",
    "# 输出结果\n",
    "print(f\"输入的整数累加和是: {total_sum}\")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
